const obj = {
	1: (g, oDegrees, alphaDegrees, h, L, k) => {
		//基于骑乘人第一落地点计算车速
		const toRadians = (degrees) => (degrees * Math.PI) / 180;

		const o = toRadians(oDegrees);
		const alpha = toRadians(alphaDegrees);

		const v =
			(Math.sqrt(g / (2 * Math.cos(o + alpha) * (h * Math.cos(o) + L * Math.sin(o)))) *
				(L * Math.cos(alpha) + h * Math.sin(alpha)) *
				3.6) /
			k;

		return v;
	},
	2: (o, iDegrees, g, s) => {
		//根据制动痕迹计算车速
		const toRadians = (degrees) => degrees * (Math.PI / 180);
		const i = toRadians(iDegrees);

		const v = Math.sqrt(2 * (o + i) * g * s) * 3.6; // 3.6 converts m/s to km/h

		return v;
	},
	3: (g, o, k, s, oDegrees) => {
		// 摩托车碰撞汽车侧面且汽车碰撞后侧向运动状态改变 g， 汽车的滑动附着系数，ks被碰撞车滑移偏向角，单位为度（rad）
		const toRadians = (degrees) => degrees * (Math.PI / 180);
		const oRadians = toRadians(oDegrees);

		const v = Math.sqrt(2 * g * o * k * s) * Math.cos(oRadians) * 3.6; // 3.6 converts m/s to km/h

		return v;
	},
	4: (m1, o1Degrees, g, o1, s1, mp, op, opDegrees, h, sp, m2, o2, k2, s2) => {
		//汽车与二轮摩托车或自行车质心侧面碰撞
		const toRadians = (degrees) => degrees * (Math.PI / 180);
		const o1Radians = toRadians(o1Degrees);
		const opRadians = toRadians(opDegrees);

		const numerator1 = m1 * Math.sin(o1Radians) * Math.sqrt(2 * g * o1 * s1);
		const numerator2 =
			mp *
			Math.sqrt(2 * g) *
			op *
			Math.sin(opRadians) *
			(Math.sqrt(h + sp / op) - Math.sqrt(h));
		const numerator3 = m2 * Math.sqrt(2 * g * o2 * k2 * s2);

		const V = ((numerator1 + numerator2 + numerator3) * 3.6) / m2;

		return V;
	},
	5: (g, o, k, s, oDegrees) => {
		//汽车与二轮摩托车或自行车质心的前侧侧面碰撞
		const toRadians = (degrees) => degrees * (Math.PI / 180);
		const oRadians = toRadians(oDegrees);

		const v = Math.sqrt(2 * g * o * k * s) * Math.cos(oRadians) * 3.6; // 3.6 converts m/s to km/h

		return v;
	},
	6: (m2, m1, mp, g, o, k, s) => {
		//汽车与自行车追尾碰撞
		const numerator = (m2 + m1 + mp) / m1;
		const v = numerator * Math.sqrt(2 * g * o * k * s) * 3.6; // 3.6 converts m/s to km/h

		return v;
	}
};
export default obj;
